package com.sc.school.controller.admin;

import com.sc.school.entity.ResponseResult;
import com.sc.school.entity.Teacher;
import com.sc.school.service.TeacherService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: sc0702
 * @description:
 * @author: LAN
 * @create: 2024-09-25 16:33
 * @version: 1.0
 **/
@RestController("adminTeacherController" )
@RequestMapping("/admin/teacher")
public class TeacherController {
    @Resource
   private TeacherService teacherService;

    @PostMapping("/save")
    public ResponseResult save(@RequestBody Teacher teacher) {
        teacherService.save(teacher);
        ResponseResult responseResult = new ResponseResult();

        return responseResult;
    }

    @DeleteMapping("/delete/{tno}")
    public ResponseResult delete(@PathVariable Integer tno) {

        teacherService.delete(tno);
        ResponseResult responseResult = new ResponseResult();


        return responseResult;
    }


}